<extend name="public@base5"/>
<block name="main">
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="nav-item">
				<a class="nav-link" href="{:url('User/index')}">{:lang('ADMIN_USER_INDEX')}</a>
			</li>
			<li class="nav-item">
				<a class="nav-link active" href="{:url('User/add')}">{:lang('ADMIN_USER_ADD')}</a>
			</li>
		</ul>
		<form method="post" class="js-ajax-form margin-top-20" action="admin/users">
			<div class="row mb-3">
				<label for="input-user_login" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>{:lang('USERNAME')}</label>
				<div class="col-md-8 col-sm-10">
					<input type="text" class="form-control" id="input-user_login" name="user_login">
				</div>
			</div>
			<div class="row mb-3">
				<label for="input-user_pass" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>{:lang('PASSWORD')}</label>
				<div class="col-md-8 col-sm-10">
					<input type="text" class="form-control" id="input-user_pass" name="user_pass" placeholder="******">
				</div>
			</div>
			<div class="row mb-3">
				<label for="input-user_email" class="col-sm-2 col-form-label text-sm-end"><span class="form-required">*</span>{:lang('EMAIL')}</label>
				<div class="col-md-8 col-sm-10">
					<input type="text" class="form-control" id="input-user_email" name="user_email">
				</div>
			</div>
			<div class="row mb-3">
				<label for="input-user_email" class="col-sm-2 col-form-label text-sm-end pt-0"><span class="form-required">*</span>{:lang('ROLE')}</label>
				<div class="col-md-8 col-sm-10">
					<foreach name="roles" item="vo">
						<div class="form-check form-check-inline">
							<php>
								$disabled='';
								if(cmf_get_current_admin_id() != 1 && $vo['id'] == 1){
									$disabled='disabled';
								}
							</php>
							<input class="form-check-input" type="checkbox" name="role_ids[]" id="role_id-checkbox-{$key}" {$disabled} value="{$vo.id}">
							<label class="form-check-label" for="role_id-checkbox-{$key}">{$vo.name}</label>
						</div>
					</foreach>
				</div>
			</div>
			<div class="row mb-3">
				<div class="offset-md-2 col-sm-10">
					<button type="submit" class="btn btn-primary js-ajax-submit">
						<i class="fa fa-save fa-fw"></i> {:lang('ADD')}
					</button>
				</div>
			</div>
		</form>
	</div>
</block>
